import request from "@/utils/request";

/* 保存对话 */
export const saveHistory = (historyData) => {
  return request({
    url: "/wlxz/historychat",
    method: "POST",
    data: {
      userId: historyData.userId,
      chatId: historyData.chatId,
      ask: historyData.ask,
      request: historyData.request.replace(/\n/g, " ").trim(),
    },
  });
};

// 删除历史对话
export function deleteHistoryChat(chatId) {
  return request({
    url: `/wlxz/historychat/${chatId}`,
    method: "put",
  });
}

// 获取历史对话列表
export function getHistoryList() {
  return request({
    url: "/wlxz/historychat/list",
    method: "get",
  });
}


